# Contributor: fancris3 <fancris3 at gmail.com>
# Contributor: Biru Ionut <biru.ionut at gmail.com>

pkgname=gfxboot
pkgver=4.1.19
_pkgver=2.1
pkgrel=2
arch=('i686' 'x86_64')
license=(GPL)
install=('gfxboot.install')
pkgdesc="Graphical Boot Logo tool"
url="http://www.opensuse.org"
depends=('perl-html-parser' 'freetype2' 'cpio' 'nasm')
makedepends=('rpmextract')
source=(http://download.opensuse.org/source/distribution/11.1/repo/oss/suse/src/${pkgname}-${pkgver}-${_pkgver}.src.rpm \
	gfxboot.html)
options=(docs)

md5sums=('cf6b45facc757fa4c93f119a22dff834'
         'f824c5bc2f716f8029677cae6956c1c7')

build() {
  echo -e "\033[1;34m :: \033[1;39m Building ... please wait \033[1;0m"

  rpmextract.sh ${pkgname}-${pkgver}-${_pkgver}.src.rpm 2>/dev/null

  for i in $(find -name '*.tar.bz2');do tar -jxf $i;done
  mv -f themes ${pkgname}-${pkgver}/

  chown -R root:root ${pkgname}-${pkgver}

  cd ${pkgname}-${pkgver}

  make -s 2>/dev/null || return 1

  make -s DESTDIR=$pkgdir installsrc || return 1

  install -d -m 755 ${pkgdir}/usr/{sbin,man/man8,share/doc/gfxboot}
  install -m 755 gfxboot gfxboot-compile gfxboot-font ${pkgdir}/usr/sbin
  install -m 644 doc/gfxboot.8 ${pkgdir}/usr/man/man8/
  install -m 644 ../gfxboot.html ${pkgdir}/usr/share/doc/gfxboot

}

# alternative source download
# source=(http://archpkg.rodp.net/src/${pkgname}-${pkgver}-${pkgrel}.src.rpm)
